<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Compoment</title>
</head>
<body>
  <div id="app"></div>
  <script type="text/javascript" src="../js/react.js"></script>
  <script type="text/javascript" src="../js/react-dom.js"></script>
  <script type="text/javascript">
    var myCompoment = React.createClass({
      render: function(){
        return React.DOM.span({id: "myCompoment"}, "this is my custom Compoment");
      }
    });

    var compomentFactory = React.createFactory(myCompoment);

    ReactDOM.render(
      // 用自定义组建创建
      // React.createElement(myCompoment),
      // 用工厂方式创建
      compomentFactory(),
      // 直接用React.createElement(标签, 属性, 子元素),
      // React.createElement("span", null, "this is 直接创建 element"),
      document.getElementById("app")
    );
  </script>
</body>
</html>
